home *** CD-ROM | disk | FTP | other *** search
/ AppleScript - The Beta Release / AppleScript - The Beta Release.iso / Documentation / develop / Better Apple Event Coding / Code Samples / TESampleGlue.a < prev    next >
Encoding:
Text File  |  1992-10-16  |  1.3 KB  |  47 lines  |  [TEXT/MPS ]

  1. ; ==========================================================================================
  2. ;
  3. ;    Program:    CPlusTESample 2.0
  4. ;    Files:        TESampleGlue.a
  5. ;
  6. ;    by Mark Bennett
  7. ;    of Apple Macintosh Developer Technical Support
  8. ;
  9. ;    Copyright © 1989-1990 Apple Computer, Inc.
  10. ;    All rights reserved.
  11. ;
  12. ; ==========================================================================================
  13.  
  14. ;
  15. ;    AsmClikLoop
  16. ;
  17. ;    This routine gets called by the TextEdit Manager from TEClick.
  18. ;    It calls the old, default click loop routine that scrolls the
  19. ;    text, and then calls our own Pascal routine that handles
  20. ;    tracking the scroll bars to follow along.  It doesn't bother
  21. ;    with saving registers A0 and D0, because they are trashed
  22. ;    anyway by TextEdit.
  23. ;
  24.  
  25. AsmClikLoop    PROC        EXPORT
  26.  
  27.             IMPORT        GETOLDCLIKLOOP
  28.             IMPORT        PASCALCLIKLOOP
  29.  
  30.             MOVEM.L        D1-D2/A1,-(SP)        ; D0 and A0 need not be saved
  31.  
  32.             CLR.L        -(SP)                ; make space for procedure pointer
  33.             JSR            GETOLDCLIKLOOP        ; get the old clikLoop
  34.             MOVEA.L        (SP)+,A0            ; into A0
  35.  
  36.             MOVEM.L        (SP)+,D1-D2/A1        ; restore the world as it was
  37.             JSR            (A0)                ; and execute old clikLoop
  38.  
  39.             MOVEM.L        D1-D2/A1,-(SP)        ; D0 and A0 need not be saved
  40.             JSR            PASCALCLIKLOOP        ; do our clikLoop
  41.             MOVEQ        #1,D0                ; clear the zero flag so TextEdit keeps going
  42.             MOVEM.L        (SP)+,D1-D2/A1        ; restore the world as it was
  43.             RTS
  44.  
  45.             END
  46.  
  47.